package designModel.singleInstance;

public class Singleton_01 {
    private static Singleton_01 instance;

    //私有化构造方法
    private Singleton_01() {
    }

    //提供静态方法获取实例
    public static Singleton_01 getInstance() {
        if (instance == null) {
            instance = new Singleton_01();
        }
        return instance;
    }

    public void doSomething() {
        System.out.println(getClass().getSimpleName() + ":简单单例");
    }
}
